package com.wantup.springboot.boot.jms.mkw.jms_activemq.springjms.consumer;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

import static java.lang.System.out;

/**
 * @author zhapluowei
 * @date 2018-11-16 1:50
 */
public class ConsumerMessageListener implements MessageListener {


    @Override
    public void onMessage(Message message) {
        TextMessage textMessage = (TextMessage) message;
        try {
            out.println("接收到的消息 ： "+textMessage.getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
